<%@page import="ContentManagers.RoleManagers.AuthenticationManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<% //employ temporary session management here
            try{
            boolean check = false;
        
            check = new AuthenticationManager().inSuchDB(1, request, response);
            
            if(check == false)
               new AuthenticationManager().redirectToProperIndex(1, request, response);
            
            else
             {
        %>

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="User Interface/css/user_int.css" />
        
    </head>
    <body>
            
        
        <%@ include file="user_header.jsp" %>
        <% //Call USER header file. The header contains the links for other pages. %> 
            
       <div id ="body_wrapper">
            <% //Actual Content of the USER Account page starts here. %>
      
            <%@ include file="default_left_sidebar.jsp" %>
            
            <div id="user_account" class="content_box">
                
                <div id="resetPassword">
                    Password Reset
                    <form name ="user_passReset" method="post" onsubmit="return validatePasswordReset()" action="ServletCustomerPasswordReset">
                        <table class="user_resetPassword">
                            <tr><td>Username: </td>
                                <td> <input class="inputbox" type="text" value="Username" name="username" autocomplete ="off" onfocus="clearInitial(this, 'Username')"/>
                                </td><tr><td>Old Password: </td> 
                                <td> <input class="inputbox" type="password" value="Old Password" name="oldPassword" autocomplete ="off" onfocus="clearInitial(this, 'Old Password')"/>
                                </td><tr><td>New Password: </td>
                                <td> <input class="inputbox" type="password" value="New Password" name="newPassword" autocomplete ="off" onfocus="clearInitial(this, 'New Password')"/>
                                </td><tr><td>Retype New Password: </td>
                                <Td><input class="inputbox" type="password" value="Retype New Password" name="newPassword2" autocomplete ="off" onfocus="clearInitial(this, 'Retype New Password')"/>
                                </td><tr><td></td><td><input type="submit" name="SubmitPasswordReset" value="Reset"/></td></table>
                        <%
                        if(session.getAttribute("message")!=null)
                        {
                            if(session.getAttribute("message").equals("0"))
                            {
                                out.println("<br>Password Reset Failed. Please check your credentials");
                            }
                            else if (session.getAttribute("message").equals("1"))
                            {
                                out.println("<br>Password Reset Successfuk."); 
                            }
                            session.removeAttribute("message");
                        }
                        %>
                    </form>
                </div>
                
                
                
            </div>
                
            <% //Actual Content of the USER Account page ends here. %>
       </div>
        
       <%@ include file="user_footer.jsp" %>
       <% //Call USER footer file %>
    </body>
</html>

<% }
    }catch(Exception e)
        { response.sendRedirect("index.jsp");}%>